#include "mainwindow.h"

#include <QApplication>
#include <QGridLayout>
#include <QLabel>
#include <QScrollArea>
#include<QWidget>
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    QWidget w1;
    w1.resize(300,200);
    QLabel *qlabel=new QLabel;
    qlabel->setScaledContents(true);
    QImage imagejpg(":/images/123.jpg");

    qlabel->setPixmap(QPixmap::fromImage(imagejpg));

    QScrollArea *sArea=new QScrollArea;
    sArea->setAlignment(Qt::AlignHCenter);


    sArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    sArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    sArea->setWidget(qlabel);
    QGridLayout *glayout=new QGridLayout;
    glayout->addWidget(sArea);
    w1.setLayout(glayout);
    w1.show();

    return a.exec();
}
